package com.xgkj.diyiketang.activity;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;

import com.xgkj.diyiketang.R;

/**
 * Created by XCKJ_Paladowow on 2016/4/15.
 */
public class ChuangJianChengGongActivity extends BaseActivity{
    private Context mContext;
    private TextView back;
    private Button mComplete;
    private TextView mCreateSuccess;
    private TextView mQiangDanSuccess;
    private String mFrom;
    private TextView mTitle;
    private TextView mText;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.chuangjian_success);
        mContext = this;
        initView();
    }

    private void initView(){
        Intent intent = getIntent();
        mFrom = intent.getStringExtra("FROM");
        back = (TextView) findViewById(R.id.back);
        back.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });
        mCreateSuccess = (TextView) findViewById(R.id.create_success);
        mQiangDanSuccess = (TextView) findViewById(R.id.qiangdan_success);
        mTitle = (TextView) findViewById(R.id.success_title);
        mText = (TextView) findViewById(R.id.chenggong);
        if(mFrom.equals("CREATE")){
            mCreateSuccess.setVisibility(View.VISIBLE);
            mTitle.setText("创建成功");
            mText.setText("创建成功");
        }else if(mFrom.equals("QIANG")){
            mQiangDanSuccess.setVisibility(View.VISIBLE);
            mTitle.setText("提交成功");
            mText.setText("提交成功");
        }else if (mFrom.equals("RESULT")){
            mTitle.setText("抢单结果");
            String result = intent.getStringExtra("RESULT");
            mText.setText(result);
        }else if(mFrom.equals("TIXIAN")){
            mTitle.setText("提现成功");
            mText.setText("提现成功");
        }
        mComplete = (Button) findViewById(R.id.complete);
        mComplete.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });
    }
}
